package me.lovatcat.springboot.demo.spring;

import me.lovatcat.springboot.demo.vo.Mobile;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author acat on 2017-01-12 14:36
 */
@Configuration
public class PropertiesBeans {

    /**
     * mobile 类中不加入任何注解，通过@Bean和@ConfigurationProperties注入
     * @return
     */
    @Bean
    @ConfigurationProperties(prefix = "mobile", locations = {"classpath:config/mobile.yml"})
    public Mobile initMobile(){
        return new Mobile();
    }

}
